#include<bits/stdc++.h>
using namespace std;
int b[15]={0};  //IN OR OUT,1=out ,0=in
int c[15]={0};  //ATTACK    1=no attack,0=attack
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n,ans=0,w=0;
	int a[15];
	cin>>n;
	if(n>10)
	{
		cout<<7;
	}
	else
	{
		for(int i=1;i<=n;i++)
		{
			cin>>a[i];
		}
		for(int i=1;i<=n-1;i++)
		{
			if(a[i]<a[i+1])
			{
				b[i]=1;
				c[i+1]=1;
			}
			else if(a[i]==a[i+1])
			{
				w++;
			}
			else if (c[i]==0)
			{
				b[i+1]=1;
				c[i]=1;
			}
		}
	}
	for(int i=1;i<=n;i++)
	{
		if(b[i]==0)
		{
			ans++;
		}
	}
	cout<<ans;
	return 0;
}
